import request from '@/utils/request'

export function getAreaSelect() {
    return request({
        url: '/sys/area/getSelectLists',
        method: 'get'
    })
}
// 查询地区 省/市
export function getAreaCitySelect() {
    return request({
        url: `/sys/area/getSelectCityLists`,
        method: 'get',
    })
}

// 查询地区 省/市
export function getParentLists() {
    return request({
        url: `/sys/area/getParentLists`,
        method: 'get',
    })
}




export function getListArea(params, get_url = false) {
    var url = '/sys/area';
    if (get_url) return url;
    return request({
        url: url,
        method: 'get',
        params
    })
}

export function createArea(data, get_url = false) {
    var url = `/sys/area/create`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'post',
        data
    })
}

export function updateArea(data, get_url = false) {
    var url = `/sys/area/update`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'put',
        data
    })
}

export function delArea(data, get_url = false) {
    var url = `/sys/area/delete`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'delete',
        data
    })
}

export function changeFiledStatus(data, get_url = false) {
    var url = `/sys/area/changeFiledStatus`;
    if (get_url) return url;
    return request({
        url: url,
        method: 'put',
        data
    })
}
